{include file="base/header" /}
<div class="panel admin-panel margin-top" id="add">
    <div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 修改内容</strong></div>
    <div class="body-content">
        <form method="post" class="form-x" enctype="multipart/form-data" action="{:url($controller.'/updates')}">
            <input type="hidden" name="id" value="{$info.id}">
            <div class="form-group">
                <div class="label">
                    <label>标题：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="{$info.title}" name="title" data-validate="required:请输入标题" />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>排序：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" name="orders" value="{$info.orders}"  data-validate="required:,number:排序必须为数字" />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>状态：</label>
                </div>
                <div class="field">
                    <input type="radio" name="status" value="1" {if condition="$info.status eq 1"}checked="checked"{/if} />启用
                    <input type="radio" name="status" value="2" {if condition="$info.status eq 2"}checked="checked"{/if}/>禁用
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>权限：</label>
                </div>
                <button type="button"  class="button border-green" id="checkall"><span class="icon-check"></span> 全选</button>

                <div class="field">
                    {volist name="nodelist" id="val"}
                    <input type="checkbox" name="node_id[]" value="{$val.id}"
                          {volist name="info.node_ids" id="vo"} {if condition="$val.id eq $vo"}checked="checked"{/if}{/volist}
                            />{$val.title}
                    {/volist}
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    $("#checkall").click(function(){
        $("input[name='id[]']").each(function(){
            if (this.checked) {
                this.checked = false;
            }
            else {
                this.checked = true;
            }
        });
    })
</script>
{include file="base/footer" /}